<template>
  <view class="page-wrapper">
    <nav-bar title="附件展示"></nav-bar>

    <view class="page-main">
      <uni-section title="附件" type="line" class="mt-10">
        <view class="files-box bgc-fff">
          <!-- 附件 -->
          <uni-swipe-action>
            <template v-for="(item, index) in info.files" :key="item.fileno">
              <uni-swipe-action-item
                :right-options="info.options2"
                @click="bindClick(item, $event)"
              >
                <view class="files-item">
                  <view class="files-left">
                    <FileIcon :filename="item.filename" />
                  </view>
                  <view class="files-right">
                    <view class="files-name">{{ item.filename }}</view>
                  </view>
                </view>
              </uni-swipe-action-item>
            </template>
          </uni-swipe-action>
        </view>
      </uni-section>
    </view>
  </view>
</template>

<script setup>
const info = reactive({
  files: [
    {
      fileno: '附件2',
      filename: '1725075053119.jpg',
    },
    {
      fileno: '113123123',
      filename: '17250750531191.mp3',
    },
    {
      fileno: '附件2',
      filename: '1725075053119.mp4',
    },
    {
      fileno: '附件2',
      filename: '1725075053119.zip',
    },
  ],
  options2: [
    {
      text: '删除',
      style: {
        backgroundColor: '#dd524d',
      },
    },
  ],
});
const recordBack = (res) => {
  console.log('录音完成', res);
  /*
  [
      {
          "docname": "1725075053119.mp3",
          "seq": "1725076172632"
      }
  ]
  */
};
</script>
